<head>
</head>
<body onload="onload()">
  <button id="nav-button" onclick="nav();">Navigate</button>
  <div id="manual-explanation" style="display: none; color: blue">When running this test outside of DRT, please click on the "Navigate" button.</div>
</body>
<script>
  if (window.testRunner) {
      testRunner.clearBackForwardList();
      testRunner.waitUntilDone();
  }

  if (window.eventSender) {
      var navButtonNode = document.getElementById('nav-button');
      eventSender.mouseMoveTo(
          navButtonNode.offsetLeft + navButtonNode.offsetWidth / 2,
          navButtonNode.offsetTop + navButtonNode.offsetHeight / 2);
      eventSender.mouseDown();
      eventSender.mouseUp();
  } else {
      document.getElementById('manual-explanation').style.display = '';
  }

  function nav() {
      window.location.href = 'resources/redirect-target.html#2';
  }

  function onload() {
      window.console.log('FAIL: Should not have reached onload before navigating away');
  }
</script>

